<div class="breadcrumb">
        <a href="/admin/index">Home</a>
         :: <a href="/admin/listgroupuser">User Group</a>
</div>
	<?php  if(isset($this->success)) {?>
<div class="success" style="text-align: center;"><?php echo $this->success;?></div>
	<?php }?>
	<?php if(isset($this->warning)) {?>
<div class="warning" style="text-align: center;"><?php  echo $this->warning;?></div>
	<?php }?>
<div class="box">
    <div class="heading">
      <h1><img alt="" src="/images/admin/user-group.png"> User Group</h1>
      <div class="buttons"><a class="button" onclick="$('#form').submit();"><?php echo $this->button;?></a><a class="button" onclick="location = '<?php echo $this->cancel;?>';">Cancel</a></div>
    </div>
    <div class="content">
      <form id="form" enctype="multipart/form-data" method="post" action="<?php echo $this->action;?>">
        <table class="form">
          <tbody><tr>
            <td><span class="required">*</span> User Group Name:</td>
            <td><input type="text" maxlength="45" value="<?php if(isset($this->name)) echo $this->name;?>" name="name">
              </td>
          </tr>
          <tr>
            <td>Access Permission:</td>
            <td>
            <div class="scrollbox">
                <?php $class = 'odd'; ?>
                <?php foreach ($this->permissions as $permission) { ?>
                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                <div class="<?php echo $class; ?>">
                  <?php if (in_array($permission, $this->access)) { ?>
                  <input type="checkbox" name="permission[access][]" value="<?php echo $permission; ?>" checked="checked" />
                  <?php echo $permission; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="permission[access][]" value="<?php echo $permission; ?>" />
                  <?php echo $permission; ?>
                  <?php } ?>
                </div>
                <?php } ?>
              </div>
              &nbsp<a onclick="$(this).parent().find(':checkbox').attr('checked', true);">Select All</a> / 
              <a onclick="$(this).parent().find(':checkbox').attr('checked', false);">UnSelect All</a></td>
          </tr>
          
          <tr>
            <td>Modify admin Page Permission:</td>
            <td><div class="scrollbox">
                <?php $class = 'odd'; ?>
                <?php foreach ($this->permissions as $permission) { ?>
                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                <div class="<?php echo $class; ?>">
                  <?php if (in_array($permission, $this->modify)) { ?>
                  <input type="checkbox" name="permission[modify][]" value="<?php echo $permission; ?>" checked="checked" />
                  <?php echo $permission; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="permission[modify][]" value="<?php echo $permission; ?>" />
                  <?php echo $permission; ?>
                  <?php } ?>
                </div>
                <?php } ?>
                
              </div>
              &nbsp<a onclick="$(this).parent().find(':checkbox').attr('checked', true);">Select All</a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);">UnSelect All</a></td>
          </tr>
          <tr>
            <td>Modify SideBar Widget Permission:</td>
            <td>
				<div class="scrollbox">
                <?php $class = 'odd'; ?>
                 <?php foreach ($this->widgets as $permission) { ?>
                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                <div class="<?php echo $class; ?>">
                  <?php if (in_array($permission['module_code'], $this->modify_widget)) { ?>
                  <input type="checkbox" name="permission[modify_widget][]" value="<?php echo $permission['module_code']; ?>" checked="checked" />
                  <?php echo $permission['module_title']; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="permission[modify_widget][]" value="<?php echo $permission['module_code']; ?>" />
                  <?php echo $permission['module_title']; ?>
                  <?php } ?>
                </div>
                <?php } ?>
              </div>
              &nbsp<a onclick="$(this).parent().find(':checkbox').attr('checked', true);">Select All</a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);">UnSelect All</a>
			</td>
          </tr>
          <tr>
            <td>Modify Content Widget Permission:</td>
            <td><div class="scrollbox">
                <?php $class = 'odd'; ?>
                 <?php foreach ($this->currentpage as $permission) { ?>
                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                <div class="<?php echo $class; ?>">
                  <?php if (in_array($permission['module_code'], $this->modify_content)) { ?>
                  <input type="checkbox" name="permission[modify_content][]" value="<?php echo $permission['module_code']; ?>" checked="checked" />
                  <?php echo $permission['module_title']; ?>
                  <?php } else { ?>
                  <input type="checkbox" name="permission[modify_content][]" value="<?php echo $permission['module_code']; ?>" />
                  <?php echo $permission['module_title']; ?>
                  <?php } ?>
                </div>
                <?php } ?>
              </div>
              &nbsp<a onclick="$(this).parent().find(':checkbox').attr('checked', true);">Select All</a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);">UnSelect All</a>
			</td>
          </tr>
        </tbody></table>
      </form>
    </div>
  </div>
